<?php 
$this->template->add_js_lib("js.js");
?>
<div class="playercontainer">
	<div class="container">
		<div class="detail_player">
			<iframe width="980" height="555"
				src="<?php echo get_embeded_link($video->VID_LINK, $video->VID_TYPE); 
				?>"
				frameborder="0" allowfullscreen="true"> </iframe>
			<div style="width: 172px;height: 44px;position: absolute;margin-left: 805px;z-index: 998;margin-top: -85px;"></div>
		</div>
		<div class="video_list_outer">
			<ul class="video_list" id="vlist">
				<?php
				if ($series_videos)
					foreach ($series_videos as $v ) {
						?>
					<li>
						<a <?php echo ($video->VID_ID == $v->VID_ID ) ? 'class="active"' : '';?> href="<?php echo video_url($v->VID_ID, $v->VID_CODE, $programCode)?>"> <img src="<?php echo video_image($v->VID_LINK); ?>"
									alt="<?php echo $v->VID_TITLE; ?>" title="<?php echo $v->VID_TITLE; ?>"/>
						<div class="description">
							<h4><?php echo $v->VID_TITLE; ?></h4>
						</div>
						</a>
					</li>
				<?php
					}
				?>
			</ul>
		</div>
		<br class="clear" />
		<br />
	</div>
</div>

<div class="container" id="main">

	<div class="leftSide">
		
		<div class="detail_title sec-title"><a href="<?php echo video_url($video->VID_ID, $video->VID_CODE, $programCode)?>" title="<?php echo $video->VID_TITLE;?>"><?php echo $video->VID_TITLE;?></a></div>
		<div class="detail_cp">
			<span class="views"><?php echo $video->VID_VIEW;?></span> <span
				class="comments"><fb:comments-count href="<?php echo video_url($video->VID_ID,$video->VID_CODE,$program->PROG_CODE);?>">0</fb:comments-count></span>
			<span><div class="fb-like"
					data-href="<?php echo video_url($video->VID_ID,$video->VID_CODE,$program->PROG_CODE);?>" data-width="50px"
					data-height="30px" data-colorscheme="light" data-layout="button"
					data-action="like" data-show-faces="false" data-send="false"
					data-share="true"></div></span>
		</div>
		
		<br />
		<div class="cmt-box">
			<fb:comments href="<?php echo video_url($video->VID_ID,$video->VID_CODE,$program->PROG_CODE);?>" width="690" num_posts="10"></fb:comments>
			
		</div>
	</div>
	<div class="rightSide">
		<?php 
			widget('fanpagefacebook');
		?>
		<?php dynamic_sidebar('right-detail'); ?>
		
	</div>
	
	<br class="clear" />
	
	<?php
		if ($series) foreach ($series as $sery) {
			$vs = $this->mvideo->gets_by_series($sery->SER_ID, 4);
			if (count($vs) <= 0) 
			continue;
		?>
        <div class="main-list">
            <div class="title">
				<?php echo $sery->SER_TITLE;?>
                <span></span>
            </div>
			<?php if ($vs) foreach ($vs as $v) { ?>
				<div class="main-item">
					<a href="<?php echo video_url($v->VID_ID, $v->VID_CODE, $program->PROG_CODE); ?>">
						<div class="thumb"><img src="<?php echo video_image($v->VID_LINK); ?>; ?>" alt="" />
							<div class="duration"><?php echo date("i:s", $v->VID_TIME);?></div>
						</div>
						<div class="description">
							<h4 class="title">
								<?php echo $v->VID_TITLE; ?>
							</h4>
							<h5 class="subtitle">
								&nbsp;
							</h5>
						</div>
					</a>
					<div class="clear"></div>
				</div>
			<?php 	} ?>
        </div>	
	<?php } ?>
	<div class="clear"></div>
</div>

<script type="text/javascript">
$(function () {
$( ".video_list_outer" ).scrollLeft( $('.video_list .active').offset().left - $('.video_list .active').width()*2.5 );
});
</script>